#ifndef __MPU6050_H
#define __MPU6050_H

// 姿态数据结构
typedef struct {
    float pitch;        // 俯仰角 (度)
    float roll;         // 横滚角 (度)
    float yaw;          // 偏航角 (度)
} Attitude;

// 安装方向配置
typedef enum {
    MPU_MOUNT_HORIZONTAL,    // 水平安装，Z轴朝上
    MPU_MOUNT_VERTICAL_Y_UP, // 竖直安装，Y轴朝上
    MPU_MOUNT_VERTICAL_X_UP  // 竖直安装，X轴朝上
} MPU_MountOrientation;

void MPU6050_Init_I2C(void);
void MPU6050_WriteReg(uint8_t RegAddress, uint8_t Data);
uint8_t MPU6050_ReadReg(uint8_t RegAddress);
void MPU6050_Init(void);
uint8_t MPU6050_GetID(void);
void MPU6050_GetData(int16_t *AccX, int16_t *AccY, int16_t *AccZ, int16_t *GyroX, int16_t *GyroY, int16_t *GyroZ);
void UpdateAttitude(int16_t AccX, int16_t AccY, int16_t AccZ, 
                   int16_t GyroX, int16_t GyroY, int16_t GyroZ, 
                   Attitude *attitude);
void MPU6050_SetMountOrientation(MPU_MountOrientation orientation);

#endif